<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "https://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-CN"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta http-equiv="Content-Language" content="zh-CN"><link href="stylesheet.css" media="all" rel="stylesheet" type="text/css">
<title>SQL 命令</title>
<script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?d286c55b63a3c54a1e43d10d4c203e75"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script>
</head><body class="REFERENCE">
<div>
<table summary="Header navigation table" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><th colspan="5" align="center" valign="bottom">PostgreSQL 8.2.3 中文文档</th></tr>
<tr><td width="10%" align="left" valign="top"><a href="reference.html" accesskey="P">后退</a></td><td width="10%" align="left" valign="top"><a href="reference.html#AEN43559">快退</a></td><td width="60%" align="center" valign="bottom"></td><td width="10%" align="right" valign="top"><a href="reference-client.html">快进</a></td><td width="10%" align="right" valign="top"><a href="sql-abort.html" accesskey="N">前进</a></td></tr>
</table>
<hr align="LEFT" width="100%"></div>
<div class="REFERENCE"><a name="SQL-COMMANDS"></a>
<div><h1>I. SQL 命令</h1>
<div class="PARTINTRO"><a name="AEN43566"></a>
<p>这部分包含那些 PostgreSQL 支持的 SQL 命令的信息。这里的"SQL"就是该语言通常的含义；每条命令的标准兼容性信息可以在相关的参考页中找到。</p>
</div>
<div>
<dl>
<dt><b>目录</b></dt>
<dt><a href="sql-abort.html">ABORT</a>&nbsp;--&nbsp;退出当前事务</dt>
<dt><a href="sql-alteraggregate.html">ALTER AGGREGATE</a>&nbsp;--&nbsp;修改一个聚集函数的定义</dt>
<dt><a href="sql-alterconversion.html">ALTER CONVERSION</a>&nbsp;--&nbsp;修改一个编码转换的定义</dt>
<dt><a href="sql-alterdatabase.html">ALTER DATABASE</a>&nbsp;--&nbsp;修改一个数据库</dt>
<dt><a href="sql-alterdomain.html">ALTER DOMAIN</a>&nbsp;--&nbsp;修改一个域的定义</dt>
<dt><a href="sql-alterfunction.html">ALTER FUNCTION</a>&nbsp;--&nbsp;修改一个函数的定义</dt>
<dt><a href="sql-altergroup.html">ALTER GROUP</a>&nbsp;--&nbsp;修改角色名或者成员关系</dt>
<dt><a href="sql-alterindex.html">ALTER INDEX</a>&nbsp;--&nbsp;改变一个索引的定义</dt>
<dt><a href="sql-alterlanguage.html">ALTER LANGUAGE</a>&nbsp;--&nbsp;修改一个过程语言的定义</dt>
<dt><a href="sql-alteroperator.html">ALTER OPERATOR</a>&nbsp;--&nbsp;修改一个操作符的定义</dt>
<dt><a href="sql-alteropclass.html">ALTER OPERATOR CLASS</a>&nbsp;--&nbsp;修改一个操作符类的定义</dt>
<dt><a href="sql-alterrole.html">ALTER ROLE</a>&nbsp;--&nbsp;修改一个数据库角色</dt>
<dt><a href="sql-alterschema.html">ALTER SCHEMA</a>&nbsp;--&nbsp;修改一个模式的定义</dt>
<dt><a href="sql-altersequence.html">ALTER SEQUENCE</a>&nbsp;--&nbsp;修改一个序列生成器的定义</dt>
<dt><a href="sql-altertable.html">ALTER TABLE</a>&nbsp;--&nbsp;修改表的定义</dt>
<dt><a href="sql-altertablespace.html">ALTER TABLESPACE</a>&nbsp;--&nbsp;修改一个表空间的定义</dt>
<dt><a href="sql-altertrigger.html">ALTER TRIGGER</a>&nbsp;--&nbsp;修改一个触发器的定义</dt>
<dt><a href="sql-altertype.html">ALTER TYPE</a>&nbsp;--&nbsp;修改一个类型的定义</dt>
<dt><a href="sql-alteruser.html">ALTER USER</a>&nbsp;--&nbsp;修改一个数据库角色</dt>
<dt><a href="sql-analyze.html">ANALYZE</a>&nbsp;--&nbsp;收集与数据库有关的统计信息</dt>
<dt><a href="sql-begin.html">BEGIN</a>&nbsp;--&nbsp;开始一个事务块</dt>
<dt><a href="sql-checkpoint.html">CHECKPOINT</a>&nbsp;--&nbsp;强制一个事务日志检查点</dt>
<dt><a href="sql-close.html">CLOSE</a>&nbsp;--&nbsp;关闭一个游标</dt>
<dt><a href="sql-cluster.html">CLUSTER</a>&nbsp;--&nbsp;根据一个索引对某个表群集</dt>
<dt><a href="sql-comment.html">COMMENT</a>&nbsp;--&nbsp;定义或者改变一个对象的评注</dt>
<dt><a href="sql-commit.html">COMMIT</a>&nbsp;--&nbsp;提交当前事务</dt>
<dt><a href="sql-commit-prepared.html">COMMIT PREPARED</a>&nbsp;--&nbsp;提交一个早先为两阶段提交准备好的事务</dt>
<dt><a href="sql-copy.html">COPY</a>&nbsp;--&nbsp;在表和文件之间拷贝数据</dt>
<dt><a href="sql-createaggregate.html">CREATE AGGREGATE</a>&nbsp;--&nbsp;定义一个新的聚集函数</dt>
<dt><a href="sql-createcast.html">CREATE CAST</a>&nbsp;--&nbsp;定义一个用户定义的转换</dt>
<dt><a href="sql-createconstraint.html">CREATE CONSTRAINT TRIGGER</a>&nbsp;--&nbsp;定义一个新的约束触发器</dt>
<dt><a href="sql-createconversion.html">CREATE CONVERSION</a>&nbsp;--&nbsp;定义一个新的的编码转换</dt>
<dt><a href="sql-createdatabase.html">CREATE DATABASE</a>&nbsp;--&nbsp;创建一个新数据库</dt>
<dt><a href="sql-createdomain.html">CREATE DOMAIN</a>&nbsp;--&nbsp;定义一个新域</dt>
<dt><a href="sql-createfunction.html">CREATE FUNCTION</a>&nbsp;--&nbsp;定义一个新函数</dt>
<dt><a href="sql-creategroup.html">CREATE GROUP</a>&nbsp;--&nbsp;定义一个新数据库角色</dt>
<dt><a href="sql-createindex.html">CREATE INDEX</a>&nbsp;--&nbsp;定义一个新索引</dt>
<dt><a href="sql-createlanguage.html">CREATE LANGUAGE</a>&nbsp;--&nbsp;定义一种新过程语言</dt>
<dt><a href="sql-createoperator.html">CREATE OPERATOR</a>&nbsp;--&nbsp;定义一个新操作符</dt>
<dt><a href="sql-createopclass.html">CREATE OPERATOR CLASS</a>&nbsp;--&nbsp;定义一个新操作符类</dt>
<dt><a href="sql-createrole.html">CREATE ROLE</a>&nbsp;--&nbsp;定义一个新数据库角色</dt>
<dt><a href="sql-createrule.html">CREATE RULE</a>&nbsp;--&nbsp;定义一个新重写规则</dt>
<dt><a href="sql-createschema.html">CREATE SCHEMA</a>&nbsp;--&nbsp;定义一个新模式</dt>
<dt><a href="sql-createsequence.html">CREATE SEQUENCE</a>&nbsp;--&nbsp;定义一个新序列发生器</dt>
<dt><a href="sql-createtable.html">CREATE TABLE</a>&nbsp;--&nbsp;定义一个新表</dt>
<dt><a href="sql-createtableas.html">CREATE TABLE AS</a>&nbsp;--&nbsp;从一条查询的结果中定义一个新表</dt>
<dt><a href="sql-createtablespace.html">CREATE TABLESPACE</a>&nbsp;--&nbsp;定义一个新表空间</dt>
<dt><a href="sql-createtrigger.html">CREATE TRIGGER</a>&nbsp;--&nbsp;定义一个新触发器</dt>
<dt><a href="sql-createtype.html">CREATE TYPE</a>&nbsp;--&nbsp;定义一个新数据类型</dt>
<dt><a href="sql-createuser.html">CREATE USER</a>&nbsp;--&nbsp;定义一个新数据库角色</dt>
<dt><a href="sql-createview.html">CREATE VIEW</a>&nbsp;--&nbsp;定义一个新视图</dt>
<dt><a href="sql-deallocate.html">DEALLOCATE</a>&nbsp;--&nbsp;删除一个预备语句</dt>
<dt><a href="sql-declare.html">DECLARE</a>&nbsp;--&nbsp;定义一个游标</dt>
<dt><a href="sql-delete.html">DELETE</a>&nbsp;--&nbsp;删除一个表中的行</dt>
<dt><a href="sql-dropaggregate.html">DROP AGGREGATE</a>&nbsp;--&nbsp;删除一个聚集函数</dt>
<dt><a href="sql-dropcast.html">DROP CAST</a>&nbsp;--&nbsp;删除一个类型转换</dt>
<dt><a href="sql-dropconversion.html">DROP CONVERSION</a>&nbsp;--&nbsp;删除一个编码转换</dt>
<dt><a href="sql-dropdatabase.html">DROP DATABASE</a>&nbsp;--&nbsp;删除一个数据库</dt>
<dt><a href="sql-dropdomain.html">DROP DOMAIN</a>&nbsp;--&nbsp;删除一个域</dt>
<dt><a href="sql-dropfunction.html">DROP FUNCTION</a>&nbsp;--&nbsp;删除一个函数</dt>
<dt><a href="sql-dropgroup.html">DROP GROUP</a>&nbsp;--&nbsp;删除一个数据库角色</dt>
<dt><a href="sql-dropindex.html">DROP INDEX</a>&nbsp;--&nbsp;删除一个索引</dt>
<dt><a href="sql-droplanguage.html">DROP LANGUAGE</a>&nbsp;--&nbsp;删除一个过程语言</dt>
<dt><a href="sql-dropoperator.html">DROP OPERATOR</a>&nbsp;--&nbsp;删除一个操作符</dt>
<dt><a href="sql-dropopclass.html">DROP OPERATOR CLASS</a>&nbsp;--&nbsp;删除一个操作符类</dt>
<dt><a href="sql-drop-owned.html">DROP OWNED</a>&nbsp;--&nbsp;删除一个数据库角色所拥有的数据库对象</dt>
<dt><a href="sql-droprole.html">DROP ROLE</a>&nbsp;--&nbsp;删除一个数据库角色</dt>
<dt><a href="sql-droprule.html">DROP RULE</a>&nbsp;--&nbsp;删除一个重写规则</dt>
<dt><a href="sql-dropschema.html">DROP SCHEMA</a>&nbsp;--&nbsp;删除一个模式</dt>
<dt><a href="sql-dropsequence.html">DROP SEQUENCE</a>&nbsp;--&nbsp;删除一个序列</dt>
<dt><a href="sql-droptable.html">DROP TABLE</a>&nbsp;--&nbsp;删除一个表</dt>
<dt><a href="sql-droptablespace.html">DROP TABLESPACE</a>&nbsp;--&nbsp;删除一个表空间</dt>
<dt><a href="sql-droptrigger.html">DROP TRIGGER</a>&nbsp;--&nbsp;删除一个触发器</dt>
<dt><a href="sql-droptype.html">DROP TYPE</a>&nbsp;--&nbsp;删除一个数据类型</dt>
<dt><a href="sql-dropuser.html">DROP USER</a>&nbsp;--&nbsp;删除一个数据库角色</dt>
<dt><a href="sql-dropview.html">DROP VIEW</a>&nbsp;--&nbsp;删除一个视图</dt>
<dt><a href="sql-end.html">END</a>&nbsp;--&nbsp;提交当前事务</dt>
<dt><a href="sql-execute.html">EXECUTE</a>&nbsp;--&nbsp;执行一个预备语句</dt>
<dt><a href="sql-explain.html">EXPLAIN</a>&nbsp;--&nbsp;显示一个语句的执行规划</dt>
<dt><a href="sql-fetch.html">FETCH</a>&nbsp;--&nbsp;用游标从查询中抓取行</dt>
<dt><a href="sql-grant.html">GRANT</a>&nbsp;--&nbsp;赋予访问权限</dt>
<dt><a href="sql-insert.html">INSERT</a>&nbsp;--&nbsp;在表中创建新行</dt>
<dt><a href="sql-listen.html">LISTEN</a>&nbsp;--&nbsp;监听一个通知</dt>
<dt><a href="sql-load.html">LOAD</a>&nbsp;--&nbsp;加载或重新加载一个共享库文件</dt>
<dt><a href="sql-lock.html">LOCK</a>&nbsp;--&nbsp;锁定一个表</dt>
<dt><a href="sql-move.html">MOVE</a>&nbsp;--&nbsp;定位一个游标</dt>
<dt><a href="sql-notify.html">NOTIFY</a>&nbsp;--&nbsp;生成一个通知</dt>
<dt><a href="sql-prepare.html">PREPARE</a>&nbsp;--&nbsp;创建一个预备语句</dt>
<dt><a href="sql-prepare-transaction.html">PREPARE TRANSACTION</a>&nbsp;--&nbsp;为当前事务做两阶段提交的准备</dt>
<dt><a href="sql-reassign-owned.html">REASSIGN OWNED</a>&nbsp;--&nbsp;修改数据库对象的属主</dt>
<dt><a href="sql-reindex.html">REINDEX</a>&nbsp;--&nbsp;重建索引</dt>
<dt><a href="sql-release-savepoint.html">RELEASE SAVEPOINT</a>&nbsp;--&nbsp;删除一个先前定义的保存点</dt>
<dt><a href="sql-reset.html">RESET</a>&nbsp;--&nbsp;把一个运行时参数重置为缺省值</dt>
<dt><a href="sql-revoke.html">REVOKE</a>&nbsp;--&nbsp;删除访问权限</dt>
<dt><a href="sql-rollback.html">ROLLBACK</a>&nbsp;--&nbsp;退出当前事务</dt>
<dt><a href="sql-rollback-prepared.html">ROLLBACK PREPARED</a>&nbsp;--&nbsp;取消一个先前为两阶段提交准备好的事务</dt>
<dt><a href="sql-rollback-to.html">ROLLBACK TO SAVEPOINT</a>&nbsp;--&nbsp;回滚到一个保存点</dt>
<dt><a href="sql-savepoint.html">SAVEPOINT</a>&nbsp;--&nbsp;在当前事务里定义一个新保存点</dt>
<dt><a href="sql-select.html">SELECT</a>&nbsp;--&nbsp;从表或视图中取出若干行</dt>
<dt><a href="sql-selectinto.html">SELECT INTO</a>&nbsp;--&nbsp;从一条查询的结果中定义一个新表</dt>
<dt><a href="sql-set.html">SET</a>&nbsp;--&nbsp;修改运行时参数</dt>
<dt><a href="sql-set-constraints.html">SET CONSTRAINTS</a>&nbsp;--&nbsp;设置当前事务的约束检查模式</dt>
<dt><a href="sql-set-role.html">SET ROLE</a>&nbsp;--&nbsp;设置当前会话的当前用户标识符</dt>
<dt><a href="sql-set-session-authorization.html">SET SESSION AUTHORIZATION</a>&nbsp;--&nbsp;为当前会话设置会话用户标识符和当前用户标识符</dt>
<dt><a href="sql-set-transaction.html">SET TRANSACTION</a>&nbsp;--&nbsp;设置当前事务的特性</dt>
<dt><a href="sql-show.html">SHOW</a>&nbsp;--&nbsp;显示运行时参数的值</dt>
<dt><a href="sql-start-transaction.html">START TRANSACTION</a>&nbsp;--&nbsp;开始一个事务块</dt>
<dt><a href="sql-truncate.html">TRUNCATE</a>&nbsp;--&nbsp;清空一个或一组表</dt>
<dt><a href="sql-unlisten.html">UNLISTEN</a>&nbsp;--&nbsp;停止监听通知信息</dt>
<dt><a href="sql-update.html">UPDATE</a>&nbsp;--&nbsp;更新一个表中的行</dt>
<dt><a href="sql-vacuum.html">VACUUM</a>&nbsp;--&nbsp;垃圾收集以及可选地分析一个数据库</dt>
<dt><a href="sql-values.html">VALUES</a>&nbsp;--&nbsp;计算一个或一组行</dt>
</dl>
</div>
</div>
</div>
<div>
<hr align="LEFT" width="100%">
<table summary="Footer navigation table" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td width="33%" align="left" valign="top"><a href="reference.html" accesskey="P">后退</a></td><td width="34%" align="center" valign="top"><a href="index.html" accesskey="H">首页</a></td><td width="33%" align="right" valign="top"><a href="sql-abort.html" accesskey="N">前进</a></td></tr>
<tr><td width="33%" align="left" valign="top">参考手册</td><td width="34%" align="center" valign="top"><a href="reference.html" accesskey="U">上一级</a></td><td width="33%" align="right" valign="top">ABORT</td></tr>
</table>
</div>
</body></html>